#ifndef BAIL_ERROR_STRATEGY_H
#define BAIL_ERROR_STRATEGY_H

#pragma once

#include "antlr4-runtime.h"
#include "macros.h"

namespace cyclone::parser
{
    using antlr4::DefaultErrorStrategy;
    using antlr4::Parser;
    using antlr4::Token;

    class BailErrorStrategy : public antlr4::DefaultErrorStrategy
    {
        DISALLOW_COPY_AND_ASSIGN(BailErrorStrategy)
    public:
        BailErrorStrategy() = default;
        virtual ~BailErrorStrategy() = default;
        void recover(Parser *recognizer, std::exception_ptr e) override;
        Token *recoverInline(Parser *recognizer) override;
        void sync(Parser *recognizer) override;
    };

} // namespace cyclone::parser

#endif